var t = getApp(),
  e = t.requirejs("core");
Page({
  data: {
    code: false,
    consume: false,
    store: false,
    cancelindex: 0,
    diyshow: {}

  },
  onLoad: function (aa) {
    e.setting();
    this.setData({
      options: aa,
      config: getApp().config
    })
  },
  onShow: function () {
    this.get_list();
    //this.goods_like()
  },
  /**
* 下拉刷新
*/
  onPullDownRefresh: function () {
    this.onShow();
    wx.stopPullDownRefresh();
  },
  /**
   *获取订单信息
   * @param order_id 订单id
   * @param buyer_id 用户id
   * @return array
   */
  get_list: function () {
    var t = this;
    e.get("Order/GetOrder", {
       buyer_id: getApp().getCache("userinfo").uid,
       order_id: t.data.options.order_id

      //   buyer_id: getApp().getCache("userinfo").uid,
      // order_id: t.data.options.order_id
      }, function (i) {
        console.log(i)
      0 == i.code ? (i.show = true, 
      t.setData(i)) : (e.alert(i.msg), wx.redirectTo({
        url: "/yb_shop/pages/order/index"
      }))
    })
  },
  /**
   *推荐商品
   * @return array
   */
  goods_like: function () {
    var t = this;
    e.get("index/index", {}, function (res) {
      t.setData({
      goods_like: res.info.goods_list
      })
    })
  },
 /**
* 打电话
*/
  phone: function (t) {
    e.phone(t)
  },
  fuzhi:function(t){
    var cont = e.pdata(t).cont; 
    e.Clipboard(cont);
  },
  to_barcode:function(t){
var code=e.pdata(t).code;
e.jump('/yb_shop/pages/barcode/index?code='+code);
  },
   /**
* 分享
*/
  onShareAppMessage: function () {
    return e.onShareAppMessage()
  }
})